-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-132661: Add default value (of "") for Interpolation.expression
#136441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a test that checks that instantiating an Interpolation without an expression actually populates expression with the empty string and it's good to go!
Sure; done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @davepeck!
|
Thanks @davepeck for the PR, and @lysnikolaou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…ssion` (pythonGH-136441) (cherry picked from commit f1b8d01) Co-authored-by: Dave Peck <[email protected]>
|
GH-136511 is a backport of this pull request to the 3.14 branch. |
…ession` (GH-136441) (#136511) Co-authored-by: Dave Peck <[email protected]>
…n.expression` (pythonGH-136441) (python#136511) Co-authored-by: Dave Peck <[email protected]>
Per pending updates to PEP 750, we now provide an empty string default for
Interpolation.expression.If you're using t-string literals,
Interpolation.expressionis set to the original source text. But if you're writing code that createsInterpolationinstances directly, there isn't always an obvious choice forexpression.